﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Runtime.InteropServices;

namespace NetCommand
{
    [StructLayout(LayoutKind.Sequential)]
    class D2S_Login : D2S_Command
    {
        public D2S_Login()
        {
            this.Header.CMD_ID = (UInt16)CMD_ID_DEFINE.eID_D2S_LOGIN;
        }
    }
    
    [StructLayout(LayoutKind.Sequential)]
    public class Device_Info : NetStruct
    {
        [SerializeField] public UInt32 DrvID = 0;       // 编号
        [SerializeField] public byte State = 0;         // 状态
        [SerializeField] public byte IsAuto = 0;        // 是否自动
        [SerializeField] public byte IsInTimer = 0;     // 是否在定时中
        [SerializeField] public Int32 SurplusTime = 0;  // 剩余定时时间
        [SerializeField] public Int32 SurplusExec = 0;  // 剩余执行时间
    }
    
    [StructLayout(LayoutKind.Sequential)]
    public class IO_Device : D2S_Command
    {
        public IO_Device()
        {
            this.Header.CMD_ID = (ushort)CMD_ID_DEFINE.eID_D2S_IO_DEVICE;
        }
        [SerializeField] public Int16 ID = 0;
        [SerializeField] public Int32 MainID = 32;
        [SerializeField] public Byte H = 0;
        [SerializeField] public List<Device_Info> IO_DeviceInfo = new List<Device_Info>();
        [SerializeField] public List<UInt32> MainBoardID = new List<uint>();
        [SerializeField] public string Name = "12346";
    }
}
